<!DOCTYPE html>
<html lang="en">
    <head>
        <title>{{filename}} - Rules, by severity</title>
        <style>

body {
    font-family: Arial, sans-serif;
}

table td,
table th {
    border: solid #aaa 1px;
    padding: 0.2em 0.5em;
}

th {
    text-shadow: 1px 1px rgba(255, 255, 255, 0.7);
}

thead {
    -moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.5), inset 0 0.8em 3px rgba(255, 255, 255, 0.7);
    -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.5), inset 0 0.8em 3px rgba(255, 255, 255, 0.7);
}

table {
    width: 450px;
    border-spacing: 0 0;
    border-collapse: collapse;

    -moz-box-shadow: 1px 1px 10px rgba(0,0,0,0.5);
    -webkit-box-shadow: 1px 1px 10px rgba(0,0,0,0.5);
}

tr.severity-1 {
    background-color: #f3b8b8;
}

tr.severity-2 {
    background-color: #f6cbb8;
}

tr.severity-3 {
    background-color: #fde5b0;
}

tr.severity-4 {
    background-color: #eaecbd;
}

tr.severity-5 {
    background-color: #cedaba;
}

td.metric {
    background-color: white;
}

th {
    background-color: #ddd;
}

td {
    -moz-box-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5) inset;
}

.node {
    margin-top: 3em;
    margin-bottom: 2em;

    padding: 1.5em;
    width: 450px;

    background-color: #ddf;
    border: solid #bbc 1px;

    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;

    -moz-transform: rotate(3deg);
}

.node > * {
    -moz-transform: rotate(-3deg);
}

h1,
h2 {
    text-shadow: 1px 1px 2px rgba(70, 70, 150, 0.7);
}

h2 {
    font-family: "Arial Black", sans-serif;
    font-weight: normal;

    font-size: 250%;
    margin-top: -1.7em;
    margin-bottom: 0;
}

.classes {
    margin-top: 0.5em;
    text-shadow: 1px 1px rgba(255, 255, 255, 0.3);
}

.classes strong {
    color: #666;
    font-weight: normal;
}
        </style>
    </head>
    <body>
        <h1>{{filename}} - Rules, by severity</h1>
        <p>Generated {% now "g:ia jS F Y" %}</p>
        <p><a href="index.html">By host</a></p>
        <hr>
        <div id="nodes">
            {% for severity, rules in by_sev %}
            <div class="node">
                <h2>Severity {{severity}}</h2>
                <table>
                    <thead>
                        <tr>
                            <th>Host</th>
                            <th>Metric</th>
                            <th>Threshold</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for host, metric, rule in rules %}
                            <tr class="severity-{{severity}}"><td>{{host.hostname}}</td><td>{{metric.human_name}}</td><td>{{rule.condition}} {{rule.human_value}}</td></tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
            {% endfor %}
        </div>
    </body>
</html>

